<!-- index.html -->
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>购物车 - 校园二手市场</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <link rel="stylesheet" href="css/cart.css">
</head>
<body>
    <!-- 导航栏 -->
    <header class="header">
        <div class="container">
            <a href="index.html" class="logo">
                <img src="images/logo.png" alt="校园二手市场">
                <span>校园二手市场</span>
            </a>

            <nav class="nav">
                <a href="index.html"><i class="fas fa-home"></i> 首页</a>
                <a href="products.html"><i class="fas fa-list"></i> 商品</a>
                <a href="cart.html" class="active"><i class="fas fa-shopping-cart"></i> 购物车</a>
                <a href="publish.html"><i class="fas fa-plus-circle"></i> 发布</a>
                <a href="login.html" id="auth-link">
                    <img id="user-avatar" src="" alt="用户头像" class="user-avatar">
                    <span id="auth-text">登录/注册</span>
                </a>
            </nav>

            <button class="mobile-menu-btn" id="mobile-menu-btn">
                <i class="fas fa-bars"></i>
            </button>
        </div>
    </header>

    <main class="container">
        <h2 class="page-title">我的购物车</h2>

        <div class="cart-container">
            <div class="cart-items" id="cart-items">
                <!-- 购物车商品将通过JS动态加载 -->
                <div class="empty-cart">
                    <img src="images/empty-cart.png" alt="空购物车">
                    <p>您的购物车是空的</p>
                    <a href="products.html" class="btn btn-primary">去逛逛</a>
                </div>
            </div>

            <div class="cart-summary">
                <h3>订单摘要</h3>
                <div class="summary-row">
                    <span>商品总数:</span>
                    <span id="total-items">0</span>
                </div>
                <div class="summary-row">
                    <span>商品总价:</span>
                    <span id="subtotal">¥0.00</span>
                </div>
                <div class="summary-row">
                    <span>运费:</span>
                    <span id="shipping-fee">¥0.00</span>
                </div>
                <div class="summary-row total">
                    <span>应付总额:</span>
                    <span id="total-price">¥0.00</span>
                </div>
                <button class="btn btn-checkout" id="checkout-btn">去结算</button>
            </div>
        </div>
    </main>

    <footer class="footer">
        <div class="container">
            <p>&copy; 2025 校园二手市场. 保留所有权利.</p>
        </div>
    </footer>

    <script src="js/api.js"></script>
    <script src="js/cart.js"></script>
</body>
</html>